#ifndef SPEECHRECOGNITION_H
#define SPEECHRECOGNITION_H

#include <QWidget>
#include<QObject>
#include<QJsonDocument>
#include<QJsonArray>
#include<QJsonObject>
#include<QHostInfo>
#include<QFile>
#include<QMessageBox>
#include<QIODevice>
const QString baiduTokenUrl = "https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=%1&client_secret=%2&";
const QString client_id  = "YKTdEZUvUmjt44Ek5ptecsiR";
const QString client_secret = "DIFEO60TWXqMyTZV7RBEHecQaB0qdpM9";

//普通话测试
const QString baiduSpeechurl = "http://vop.baidu.com/server_api?dev_pid=1537&cuid=%1&token=%2";

namespace Ui {
class speechrecognition;
}

class speechrecognition : public QWidget
{
    Q_OBJECT

public:
    explicit speechrecognition(QWidget *parent = nullptr);
    QString getJsonvalue(QByteArray ba, QString key);
    QString speechIdentify(QString filename);
    QString  accessToken;
    ~speechrecognition();

private:
    //获取access_token相关

    Ui::speechrecognition *ui;
};

#endif // SPEECHRECOGNITION_H
